package realQuestion.shenxin;

import java.util.HashSet;
import java.util.Scanner;

public class Main3 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String input = scanner.nextLine();
        String[] s = input.split(" ");
        int i = find(s);
        System.out.println(i);


    }
    static  int find(String[] nums){
        int maxLength=0;

        for (int i = 0; i < nums.length; i++) {
            HashSet<String> set = new HashSet<>();
           int length=0;


            for (int j = i; j < nums.length ; j++) {
                if (set.contains(nums[j])){
                    break;
                }else {
                    set.add(nums[j]);
                    length++;
                }
            }
            maxLength=Math.max(maxLength,length);

        }


        return  maxLength;
    }
}
